package com.gf.user.dao.impl;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.gf.base.dao.impl.BaseDaoImpl;
import com.gf.base.type.FileType;
import com.gf.user.dao.UploadFileRecordDao;

@Service("uploadFileRecordDao")
public class UploadFileRecordDaoImpl extends BaseDaoImpl implements
		UploadFileRecordDao {

	/**
	 * insert into
	 * uploadrecord(userId,filePath,fileType,uploadtime,uploadIp) values
	 * (?,?,?,current_timestamp,?)
	 */
	@Value("${uploadFileRecordDao.insertSql}")
	private String insertSql;

	@Override
	public long insert(long userId, String filePath, FileType fileType,
			String uploadIp) {

		return this.insertWithIdReturn(insertSql, userId, filePath, fileType.toString(),
				uploadIp);
	}
}
